package com.eorchis.module.reply.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;
import com.eorchis.module.newsuserlink.domain.NewsUserLink;

/**
 * Title: Reply<br>
 * Description: 消息回复表实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author RongSL
 * @createDate 2016-05-06
 * @version $Revision$
 */
@Entity
@Table(name = "REPLY")
public class Reply extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	private String replyId;//消息回复ID
	private String replyValue;//消息回复内容
	private String userId;//回复人ID
	private Integer readState;//读取状态
	private NewsUserLink newsUserLink;//消息用户表

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="REPLY_ID")
	/**
	 * 设置消息回复ID
	 */		
	public String getReplyId() {
		return replyId;
	}
	/**
	 * 获取消息回复ID
	 */		
	public void setReplyId(String replyId) {
		this.replyId = replyId;
	}
	@Column(name="REPLY_VALUE")
	/**
	 * 设置消息回复内容
	 */		
	public String getReplyValue() {
		return replyValue;
	}
	/**
	 * 获取消息回复内容
	 */		
	public void setReplyValue(String replyValue) {
		this.replyValue = replyValue;
	}

	/**
	 * 获取消息回复读取状态
	 */
	@Column(name="read_state")
	public Integer getReadState() {
		return readState;
	}
	/**
	 * 设置消息回复读取状态
	 */
	public void setReadState(Integer readState) {
		this.readState = readState;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "消息回复ID======>" + getReplyId()+"\n消息回复内容======>" + getReplyValue();
	}
	
	@ManyToOne(cascade = CascadeType.ALL, optional = false)
	@JoinColumn(name="NEWS_USER_ID", referencedColumnName="NEWS_USER_ID")
	public NewsUserLink getNewsUserLink() {
		return newsUserLink;
	}
	public void setNewsUserLink(NewsUserLink newsUserLink) {
		this.newsUserLink = newsUserLink;
	}
	
	@Column(name="USER_ID")
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
}
